// pages/user/user.js
Page({
  data:{
    avatar:'',
    name:'',
    number:'',
    phone:'',
    month:'06',
    year:'2023',
    completedAmounts:'',//完成任务总量(实际完成时间)
    transportMileage:'',//运输里程(实际完成时间)
    taskAmounts:'',//任务总量(计划完成时间)
  },
  vehicleInfo(){
   wx.navigateTo({
     url: '/pages/vehicleInfo/vehicleInfo',
   })
  },
  taskData(){
    wx.navigateTo({
      url: '/pages/task-data/task_data',
    })
  },
  systemSettings(){
    wx.navigateTo({
      url: '/pages/sysSettings/sysSettings',
    })
  },
onLoad(){
this.getUserInfo()
this.getTaskReport()
},
//获取司机信息
 async getUserInfo(){
  const res = await wx.$http.get('/driver/users')
  // console.log(res);
  this.setData({...res})
},
async getTaskReport(){
  //获取任务数据
  const re = await wx.$http.get('/driver/users/taskReport',{month:this.data.month,year:this.data.year})
  console.log(re);
}
})